/*
  学习目标：使用props指定默认值
*/
import React from 'react';
import PropTypes from 'prop-types';

export default function App() {
  return (
    <div>
      <Child title="昨天是圣诞节"></Child>
    </div>
  );
}

class Child extends React.Component {
  static propTypes = {
    count: PropTypes.number,
  };

  // 使用defaultProps指定默认值
  static defaultProps = {
    count: 20,
  };

  render() {
    const { title, count } = this.props;
    return (
      <h1>
        {title} - {count}
      </h1>
    );
  }
}

// Child.defaultProps = {
//   count: 18,
// };
